/*
Copyright 2005-2014 CP Fricano - All Rights Reserved

This software and source code is licensed under the Apache
License, Version 2.0. You may not use this software or source
code except in compliance with the License.  You may obtain a
copy of the License at: http://www.apache.org/licenses/LICENSE-2.0.
Use and distributed under this License is on an "as is" basis,
without expressed or implied warranties or conditions of any kind.
See the License for the specific language governing permissions and
limitations.
 */

package com.fricano.java42.weather.api.provider.adapter;

import com.fricano.java42.base.components.datapointprovider.impl.AccessKey;

public enum Key implements AccessKey {

    TIME(),

    TIME_RFC822(),

    DATE(),

    TEMPERATURE(),

    TEMP_AVG(),

    LOCATION_ZIP(),

    LOCATION_FULL(),

    LOCATION_COUNTRY(),

    LOCATION_CITY(),

    WIND_SPEED(),

    LOCATION_LONGITUDE(),

    LOCATION_LATITUDE(),

    OBJECT(),

    END();

    final private static int MAX_SHARED_KEYS = 10;

    final private Object[]   shared          = new Object[MAX_SHARED_KEYS];

    private Key() {
        for (int x = 0; x != shared.length; x++) {
            final int index = x;
            shared[x] = new Object() {
                @Override
                public String toString() {
                    return name() + "." + index;
                }
            };
        }
    };

    @Override
    public Object shared(final int index) {
        return shared[index];
    }
}
